/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author bsmith
 */
@Entity
@Table(name = "merchants")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Merchants.findAll", query = "SELECT m FROM Merchants m"),
    @NamedQuery(name = "Merchants.findAllData", query = "SELECT m.id, m.merchant, m.store FROM Merchants m"),
    @NamedQuery(name = "Merchants.findById", query = "SELECT m FROM Merchants m WHERE m.id = :id"),
    @NamedQuery(name = "Merchants.findByMerchant", query = "SELECT m FROM Merchants m WHERE m.merchant = :merchant"),
    @NamedQuery(name = "Merchants.findByStore", query = "SELECT m FROM Merchants m WHERE m.store = :store")})
public class Merchants implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "merchant")
    private String merchant;
    @Size(max = 45)
    @Column(name = "store")
    private String store;

    public Merchants() {
    }

    public Merchants(Integer id) {
        this.id = id;
    }

    public Merchants(Integer id, String merchant) {
        this.id = id;
        this.merchant = merchant;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getMerchant() {
        return merchant;
    }

    public void setMerchant(String merchant) {
        this.merchant = merchant;
    }

    public String getStore() {
        return store;
    }

    public void setStore(String store) {
        this.store = store;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Merchants)) {
            return false;
        }
        Merchants other = (Merchants) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jpa.entities.Merchants[ id=" + id + " ]";
    }
    
}
